<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<div class="row">

</div>
<!-- widget grid -->
<section id="widget-grid" class="">
	<!-- row -->
	<div class="row">
		<article class="col-sm-12" id="proInfo">
			<!-- new widget -->
			<div class="jarviswidget well" id="wid-id-0"
				 data-widget-colorbutton="false"
				 data-widget-editbutton="false"
				 data-widget-togglebutton="false"
				 data-widget-deletebutton="false"
				 data-widget-fullscreenbutton="false"
				 data-widget-custombutton="false"
				 data-widget-sortable="false">


				<!-- widget div-->
				<div >
					<!-- widget edit box -->
					<div class="jarviswidget-editbox">
					</div>
					<!-- end widget edit box -->
					<!-- widget content -->
					<div class="widget-body">
						<div class="row">
							<header style="display: block;margin-left: 5px">
								<h1 >项目进度情况 / <small  class="text-danger"><strong id="wid-head"></strong></small></h1>
								<hr class="simple">
							</header>

							<form id="wizard-1" novalidate="novalidate">
								<div id="bootstrap-wizard-1" class="col-sm-12">
									<div class="form-bootstrapWizard" style="margin-bottom: 35px;">
										<ul class="bootstrapWizard form-wizard">
											<li id="prostart" data-target="#step1" key="">
												<a data-toggle="tab">
													<span class="step">1</span>
													<span class="title">项目立项</span>
												</a>
											</li>
											<li id="prolocate" data-target="#step2" key="">
												<a data-toggle="tab">
													<span class="step">2</span>
													<span class="title">项目选址</span>
												</a>
											</li>
											<li id="prostudy" data-target="#step3" key="">
												<a data-toggle="tab">
													<span class="step">3</span>
													<span class="title">可研报告编制</span>
												</a>
											</li>
											<li id="proreply" data-target="#step4" key="">
												<a data-toggle="tab">
													<span class="step">4</span>
													<span class="title">可研批复登记</span>
												</a>
											</li>

										</ul>
										<div class="clearfix"></div>
									</div>
									<div class="form-bootstrapWizard" style="margin-bottom: 35px;">
										<ul class="bootstrapWizard form-wizard">
											<li id="forest" data-target="#step5" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">5</span>
													<span class="title">林地审批登记</span>
												</a>
											</li>
											<li id="bidstart" data-target="#step5" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">6</span>
													<span class="title">勘察设计招标</span>
												</a>
											</li>
											<li id="geology" data-target="#step6" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">7</span>
													<span class="title">地址勘察登记</span>
												</a>
											</li>
											<li id="design" data-target="#step7" key="">
												<a href="#tab1" data-toggle="tab">
													<span class="step">8</span>
													<span class="title">初步设计登记</span>
												</a>
											</li>


										</ul>
										<div class="clearfix"></div>
									</div>
									<div class="form-bootstrapWizard" style="margin-bottom: 35px;">
										<ul class="bootstrapWizard form-wizard">
											<li id="condesign" data-target="#step8" key="">
												<a href="#tab2" data-toggle="tab">
													<span class="step">9</span>
													<span class="title">施工图设计</span>
												</a>
											</li>
											<li id="concheck" data-target="#step3" key="">
												<a href="#tab3" data-toggle="tab">
													<span class="step">10</span>
													<span class="title">施工图设计审查</span>
												</a>
											</li>
											<li id="plicence" data-target="#step4" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">11</span>
													<span class="title">办理工程规划许可证和土地证</span>
												</a>
											</li>
											<li id="cbidstart" data-target="#step4" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">12</span>
													<span class="title">施工、监理招标登记</span>
												</a>
											</li>


										</ul>
										<div class="clearfix"></div>
									</div>
									<div class="form-bootstrapWizard" style="margin-bottom: 35px;">
										<ul class="bootstrapWizard form-wizard">
											<li id="crecord" data-target="#step4" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">13</span>
													<span class="title">施工监理合同备案</span>
												</a>
											</li>
											<li id="clicence" data-target="#step5" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">14</span>
													<span class="title">施工许可证办理</span>
												</a>
											</li>
											<li id="proover" data-target="#step6" key="">
												<a href="#tab4" data-toggle="tab">
													<span class="step">15</span>
													<span class="title">项目竣工验收</span>
												</a>
											</li>
											<li id="proassign" data-target="#step7" key="">
												<a href="#tab1" data-toggle="tab">
													<span class="step">16</span>
													<span class="title">移交签收</span>
												</a>
											</li>


										</ul>
										<div class="clearfix"></div>
									</div>
								</div>
							</form>
						</div>
					</div>
					<!-- end widget div -->
				</div>
			</div>
			<!-- end widget -->
		</article>
		<article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
			<!-- new widget -->
			<div class="jarviswidget" id="wid-id-1"
				 data-widget-colorbutton="false"
				 data-widget-togglebutton="false"
				 data-widget-deletebutton="false"
				 data-widget-editbutton="false"
				 data-widget-fullscreenbutton="false" role="widget">
				<header>
					<span class="widget-icon">
						<i class="glyphicon glyphicon-stats txt-color-darken"></i>
					</span>
					<h2>项目列表 </h2>
				</header>
				<!-- widget div-->
				<div>
					<!-- widget edit box -->
					<div class="jarviswidget-editbox">
					</div>
					<!-- end widget edit box -->
					<!-- widget content -->
					<div class="widget-body no-padding">
						<div class="col-sm-12 col-md-12 col-lg-12">
							<div class=" ">
								<div class="row" id="ajax_proStart_list_row">
									<table id="ajax_proStart_table" class="table table-striped table-bordered table-hover">
									</table>
									<div id="ajax_proStart_list_page">
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- end widget content -->
					<!-- end widget div -->
				</div>
			</div>
		</article>
	</div>
	<!-- end row -->
</section>
<!-- end widget grid -->

<script type="text/javascript">
	// DO NOT REMOVE : GLOBAL FUNCTIONS!
	pageSetUp();
	function reload(){
		loadURL("ajax!dashboard.action",$('#content'));
	}
	$(function(){
		load_proStart_jqGrid();
	});
	function load_proStart_jqGrid(){
		jQuery("#ajax_proStart_table").jqGrid({
			url:'ajax-dashboard!list.action',
			datatype: "json",
			colNames:['项目名称 ','项目简称',"项目主要实施内容","投资规模(万元）","操作","id"],
			colModel:[
				{name:'name',index:'name', width:30,sortable:false},
				{name:'subname',index:'subname', width:70},
				{name:'content',index:'content', width:120,sortable:false},
				{name:'money',index:'money', width:110,sortable:false},
				{name:'act',index:'act', width:150,sortable:false,fixed:true},
				{name:'id',index:'id', width:50,hidden:true},
			],
			rowNum : 10,
			rowList:[10,20,30],
			pager : '#ajax_proStart_list_page',
			sortname : 'id',
			sortorder : "asc",
			gridComplete:function(){
				var ids=$("#ajax_proStart_table").jqGrid('getDataIDs');
				for(var i=0;i<ids.length;i++){
					var cl=ids[i];
					var de="<button class='btn btn-default' data-original-title='查看' onclick=\"fn_pro_read('"+cl+"');\"><i class='fa fa-eye'></i>查看项目进度</button>"+" ";
					jQuery("#ajax_proStart_table").jqGrid('setRowData',ids[i],{act:de});
				}
				$(".ui-jqgrid-bdiv").css("overflow-x","hidden");
				jqGridStyle();
			},
			jsonReader: {
				root: "dataRows",
				page: "page",
				total: "total",
				records: "records",
				repeatitems : false
			},
			onSelectRow:fn_pro_read,
			multiselect : false,
			rownumbers:true,
			gridview:true,
			shrinkToFit:true,
			viewrecords: true,
			autowidth: true,
			height:'auto',
			forceFit:true,
			loadComplete: function() {
			}
		});
		$(window).on('resize.jqGrid', function() {
			jQuery("#ajax_proStart_table").jqGrid('setGridWidth', $("#ajax_proStart_list_row").width());
		})

		jQuery("#ajax_proStart_table").jqGrid('navGrid', "#ajax_proStart_list_page", {
			edit : false,
			add : false,
			del : false,
			search:false
		});
	};
	function fn_pro_read(id){
		var data={keyId:id};
		$.ajax({
			url : "ajax-prostart!proInfo.action",
			method:"post",
			cache : false,
			dataType : "json",
			async : false,
			data : data,
			success : function(data) {
				if(data.state!=200){
					_show(data);
					return;
				}
				$("#proInfo").hide();
				$( "#proInfo" ).show( "slide", "swing", 500,function(){
					$("#wid-head").html(data.proName);
					for(var key in data){
						if(data[key] !=0){
							$("#"+key).addClass("active").attr("key","1");
						}else{
							$("#"+key).removeClass("active").attr("key","0");
						}
					}
				});
			}
		});
	}

	$("div.form-bootstrapWizard li").unbind().bind("click",function(e){
		var gridObj = $("#ajax_proStart_table").jqGrid("getGridParam","selrow");
		var actionUrl = "ajax!"+$(this).attr("id")+".action";
		loadURL(actionUrl,$('#content'),{data:{keyId:gridObj,rows:10}});
	});


</script>

